/* pts00KeepAlive.cpp
 *
 * --
 * Copyright (c) 2012, Christophe Huriaux
 * Distributed under the terms of the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * --
 */

#include <packet/pts00KeepAlive.h>
#include <wrapper/JavaStreamWrapper.h>

pts00KeepAlive::pts00KeepAlive()
    : McPacketToServer(0x00), id(0)
{
}

pts00KeepAlive::pts00KeepAlive(int32_t id)
    : McPacketToServer(0x00), id(id)
{
}

unsigned int pts00KeepAlive::length()
{
    return 1 + 4;
}

void pts00KeepAlive::forge(std::ostream& out)
{
    JavaStreamWrapper jsw(out);

    jsw.writeByte(getPacketId());
    jsw.writeInt(id);

}

int32_t pts00KeepAlive::getId()
{
    return id;
}


void pts00KeepAlive::setId(int32_t id)
{
    this->id = id;
}


